package jtk.project4.fleet.field;

/*
* Author : Rio Dermawan 
* Date Created : 1-April-2011
* Date Modified : 6-April-2011
* Version : 1.1
* */

import java.awt.Dimension;

import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.CalendarControl;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.ComboField;
import nl.coderight.jazz.form.field.TextField;
import nl.coderight.jazz.form.field.button.PushButton;

public class AddGeneralExpenseField extends GroupControl {
	private TextField EquipmentField;
	private CalendarControl DateField;
	private TextField MileageField;
	private ComboField<String> ExpenseField;
	private PushButton AddField;
	private ComboField<String> CostCenterField;
	private TextField CostField;
	private TextField NotesField;
	
	public AddGeneralExpenseField(String bindID){
		setTitle("header.AddGeneralExpense"); //disesuaikan dengan nama field
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	private void createFields()
	{
		Dimension dimension = new Dimension(166, 20);
		EquipmentField = new TextField("EquipmentField", 20);
		
		DateField = new CalendarControl("DateField", 20);
		DateField.setPreferredSize(dimension);
		
		MileageField = new TextField("MileageField", 20);
		
		ExpenseField = new ComboField("ExpenseField", "");
		ExpenseField.setPreferredSize(dimension);
		
		AddField = new PushButton("...");
		
		CostCenterField = new ComboField("CostCenterField", "");
		CostCenterField.setPreferredSize(dimension);
		
		CostField = new TextField("CostField", 20);
		
		NotesField = new TextField("NotesField", 20);
		
	}
	
	
	private void createLayout()
	{
		setLayout(new FormLayout())

		.addLabel("label.Equipment :")	 .addField(EquipmentField)
		.addRow()
		.addLabel("label.Date :")		 .addField(DateField)
		.addRow()
		.addLabel("label.Mileage :")	 .addField(MileageField)
		.addRow()
		.addLabel("label.Expense :") 	 .addField(ExpenseField)
		.addLabel("")					 .addField(AddField)
		.addRow()
		.addLabel("label.Cost Center :") .addField(CostCenterField)
		.addRow()
		.addLabel("label.Cost :") 		 .addField(CostField)
		.addRow()
		.addLabel("label.Notes :") 		 .addField(NotesField)
		.addRow();
	}
}
